import market

def print_menu():
    print('----可选业务----')
    print('1.查看所有商品信息；')
    print('2.查找商品；')
    print('3.添加商品；')
    print('4.修改商品价格和折扣；')
    print('5.删除商品；')
    print('6.查看所有订单；')
    print('7.删除订单；')
    print('8.订单统计；')
    print('9.商品结算（添加订单）；')
    print('10.退出')

def main():
    while True:
        print_menu()
        choice = int(input('请输入你的选择：'))
        if choice == 1:
            market.show_products()
        elif choice == 2:
            market.get_product()
        elif choice == 3:
            market.add_product()
        elif choice == 4:
            market.mod_product()
        elif choice == 5:
            market.del_product()
        elif choice == 6:
            market.show_orders()
        elif choice == 7:
            market.del_order()
        elif choice == 8:
            market.count_orders()
        elif choice == 9:
            market.add_order()
        elif choice == 10:
            print('退出成功')
            break
        else:
            print('输入有误，请重新输入')


if __name__ == '__main__':
    main()
